package com.igroupes.ovineherd.model.Style;

import com.igroupes.ovineherd.exception.ModelException;
import lombok.Data;
import lombok.ToString;

@Data
@ToString(callSuper = true)
public abstract class ShowStyle implements IStyle{
    protected Boolean show; //是否显示 , 前段显示，
    protected Object value = "";  //传值
    protected ShowStyle(){

    }
    protected ShowStyle(Object value) {
        this.show = true;
        this.value = value;
    }

    @Override
    public Boolean verify(Object o) {
        ShowStyle showStyle = (ShowStyle) o;
        if(!(showStyle.getShow() instanceof Boolean)){
            throw new ModelException("show传值类型错误");
        }
        return true;
    }
}
